/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package univer;

import org.apache.log4j.*;
import org.apache.log4j.jmx.LoggerDynamicMBean;
import org.apache.log4j.spi.ErrorHandler;
import org.apache.log4j.spi.Filter;
import org.apache.log4j.spi.LoggingEvent;



/**
 *
 * @author fairdev
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

    	Logger logger = Logger.getLogger(Main.class);
    
    	
        try {
            ConnManagerDao dao = new ConnManagerDao();
            Department dep = dao.getDepartmentById(2);
            logger.info("Successfully");
            System.out.println(dep.getName());
            logger.debug("Find result:" + dep.getName());
        }
        catch (Exception e) {
            System.err.println(e.toString());
            logger.error("Throw exception:" + e.toString());
        }

    }

}
